﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RoleManage.aspx.cs" Inherits="Admin_RootAndPowerManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="../css/PageStyle.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div style="float: left">
        <h1 style="text-align: center">
            角色管理</h1>
        <div>
            角色名：<asp:TextBox ID="tbRootName" runat="server" Width="180px"></asp:TextBox></div>
        <div style="margin-left: 100px; margin-top: 10px">
            <asp:Button ID="btnSure" runat="server" Text="添加" OnClick="btnSure_Click"></asp:Button>&nbsp;
            <asp:Button ID="btnCancel" runat="server" Text="取消" OnClick="btnCancel_Click" CausesValidation="False">
            </asp:Button>
        </div>
        <div>
            <asp:Label ID="lblRoleId" runat="server" Visible="False"></asp:Label>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbRootName"
                ErrorMessage="角色名不能为空"></asp:RequiredFieldValidator>
        </div>
        <div>
            <asp:GridView ID="gridRole" runat="server" AutoGenerateColumns="False" CellPadding="4"
                ForeColor="#333333" GridLines="None" DataKeyNames="id_key" Width="99%" OnSelectedIndexChanging="gridRole_SelectedIndexChanging"
                OnRowDeleting="gridRole_RowDeleting">
                <RowStyle BackColor="#EFF3FB" />
                <Columns>
                    <asp:BoundField HeaderText="ID" DataField="id_key" />
                    <asp:BoundField HeaderText="角色名" DataField="role_name" />
                    <asp:CommandField SelectText="修改" ShowSelectButton="True" />
                    <asp:CommandField DeleteText="&lt;div id=&quot;de&quot; onclick=&quot;JavaScript:return confirm('请确认该角色下没有用户否则无法删除！一旦删除无法恢复！')&quot;&gt;删除&lt;/div&gt;"
                        ShowDeleteButton="True" />
                    <asp:HyperLinkField Text="分配权限" DataNavigateUrlFields="id_key" DataNavigateUrlFormatString="PowerManage.aspx?id={0}"
                        Target="power" />
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
        </div>
    </div>
    </form>
</body>
</html>
